package cn.jltx.rxjava.rx;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.jltx.rxjava.rx.learn.RxJava2Learn3;

/**
 * @author jltxseo
 *         Created by junlintianxia on 2017/08/11.
 */

public class Learn3Activity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_learn3);
        setTitle("笔记三");
        ButterKnife.bind(this);
    }

    @OnClick({R.id.btn1,R.id.btn2,R.id.btn3,R.id.btn4,R.id.btn5})
    public void onClick(View view){
        switch (view.getId()){
            case R.id.btn1:
                RxJava2Learn3.noScheduler();
                break;
            case R.id.btn2:
                RxJava2Learn3.subscribeOnScheduler();
                break;
            case R.id.btn3:
                RxJava2Learn3.observeOnScheduler();
                break;
            case R.id.btn4:
                RxJava2Learn3.subscribeAndobserveOnScheduler();
                break;
            case R.id.btn5:
                RxJava2Learn3.subscribeAndobserveOnNestScheduler();
                break;
        }
    }
}
